package com.qf.smartdevice.mapper;

import com.qf.smartdevice.pojo.Menu;
import com.qf.smartdevice.pojo.Menus;

import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by jackiechan on 2021/6/7 15:32
 *
 * @author jackiechan
 */

public interface MenuMapper {
    @Select("SELECT * FROM menus")
    List<Menus> findAllMenus();


    @Select("SELECT m.* FROM menu m left join role_menu rm on m.id = rm.menu_id where rm.role_id = #{roleid}")
    List<Menu> findMenusByRoleId(Long roleid);

    @Select("SELECT * FROM menu")
    List<Menu> findAllRealMenus();
}
